/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.baladaboa.ws.core;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Leone
 */
@Entity
@Table(name = "contato", catalog = "dbbaladaboa", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Contato.findAll", query = "SELECT c FROM Contato c"),
    @NamedQuery(name = "Contato.findByIdcontato", query = "SELECT c FROM Contato c WHERE c.idcontato = :idcontato"),
    @NamedQuery(name = "Contato.findByDescricao", query = "SELECT c FROM Contato c WHERE c.descricao = :descricao"),
    @NamedQuery(name = "Contato.findByResponsavel", query = "SELECT c FROM Contato c WHERE c.responsavel = :responsavel")})
public class Contato implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idcontato", nullable = false)
    private Integer idcontato;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 100)
    @Column(name = "descricao", nullable = false, length = 100)
    private String descricao;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 55)
    @Column(name = "responsavel", nullable = false, length = 55)
    private String responsavel;
    @JoinColumn(name = "ponto_taxi_idponto_taxi", referencedColumnName = "idponto_taxi")
    @ManyToOne
    private PontoTaxi pontoTaxiIdpontoTaxi;
    @JoinColumn(name = "forma_contato_idforma_contato", referencedColumnName = "idforma_contato", nullable = false)
    @ManyToOne(optional = false)
    private FormaContato formaContatoIdformaContato;
    @JoinColumn(name = "cliente_idcliente", referencedColumnName = "idcliente")
    @ManyToOne
    private Cliente clienteIdcliente;

    public Contato() {
    }

    public Contato(Integer idcontato) {
        this.idcontato = idcontato;
    }

    public Contato(Integer idcontato, String descricao, String responsavel) {
        this.idcontato = idcontato;
        this.descricao = descricao;
        this.responsavel = responsavel;
    }

    public Integer getIdcontato() {
        return idcontato;
    }

    public void setIdcontato(Integer idcontato) {
        this.idcontato = idcontato;
    }

    public String getDescricao() {
        return descricao;
    }

    public void setDescricao(String descricao) {
        this.descricao = descricao;
    }

    public String getResponsavel() {
        return responsavel;
    }

    public void setResponsavel(String responsavel) {
        this.responsavel = responsavel;
    }

    public PontoTaxi getPontoTaxiIdpontoTaxi() {
        return pontoTaxiIdpontoTaxi;
    }

    public void setPontoTaxiIdpontoTaxi(PontoTaxi pontoTaxiIdpontoTaxi) {
        this.pontoTaxiIdpontoTaxi = pontoTaxiIdpontoTaxi;
    }

    public FormaContato getFormaContatoIdformaContato() {
        return formaContatoIdformaContato;
    }

    public void setFormaContatoIdformaContato(FormaContato formaContatoIdformaContato) {
        this.formaContatoIdformaContato = formaContatoIdformaContato;
    }

    public Cliente getClienteIdcliente() {
        return clienteIdcliente;
    }

    public void setClienteIdcliente(Cliente clienteIdcliente) {
        this.clienteIdcliente = clienteIdcliente;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idcontato != null ? idcontato.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Contato)) {
            return false;
        }
        Contato other = (Contato) object;
        if ((this.idcontato == null && other.idcontato != null) || (this.idcontato != null && !this.idcontato.equals(other.idcontato))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.com.baladaboa.ws.core.Contato[ idcontato=" + idcontato + " ]";
    }
    
}
